package com.zhu.shiroweb.controller;


import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 
 * @author zhu
 *
 */
@Controller
public class PermissionsController {
	/**
	 *
	 * @param user
	 * @param request
	 * @return
	 */
	@RequestMapping("/permissions")
	public String permissionTest(){
		Subject subject = SecurityUtils.getSubject();
		if(subject.isPermitted("create")) {
			return "permission";
		}else {
			return "login";
		}
		
	}
	

}
